$drag-tag-form-color: #333;
$drag-tag-form-border-color: rgb(238, 238, 238);
$drag-tag-form-th-bg:rgb(232, 232, 232);
$drag-tag-form-th-color:#333;
$drag-tag-form-tr-bg:#fff;
$drag-tag-form-tr-color:#333;
$drag-tag-form-tr-border-color:rgb(219, 219, 219);

$drag-tag-form-transition-duration: 300ms;
$drag-tag-form-transition-timing-function: linear;
.drag-tag-form-box{
    width: 100%;
    // @include flexLayout(flex, normal, normal);
    padding: .1rem 0;
    .drag-tag-form__title{
        flex: 0 0 auto;
        width: 120px;
        padding: .14rem 0 .14rem;
        white-space: nowrap;
        color: $drag-tag-form-color;
        font-size: .14rem;
        text-align: left;
    }
    .drag-tag-form__table{
        flex: 1;
        width: 100%;
    }
    .drag-tag-form__tbody{
        width: 100%;
        &>span{
            display: block;
            @include flexLayout(flex,justify,normal);
            flex-wrap: wrap;
            min-height: 0.5rem;
        }
        ::v-deep{
            .sortable-chosen{
                width: 100%;
                list-style-type: none;
                &>.el-button{
                    width: 100%;
                    height: 100%;
                    background-color: transparent;
                }
            }
            .form-item {
                width: 46%;
                padding: 12px 20px 24px 10px;
                border-radius: 8px;
                border: 1px solid transparent;
                .form-item-input {
                    width: 100%;
                    textarea {
                        background: transparent;
                    }
                }
            }
            .child-table {
                width: 100%;
                padding: 12px 20px 24px 10px;
                .control-item-name {
                    @include textEllipsis();
                    font-size: 16px;
                    font-family: "PingFang SC Medium";
                    line-height: 22px;
                    color: #37383a;
                    margin: 0 0 7px 0;
                }
                .child-table-content {
                    width: 100%;
                    overflow-x: auto;
                    display: flex;
                    justify-content: flex-start;
                    align-items: center;
                    .drag-tag-form-box {
                        width: unset;
                        padding: 0;
                    }
                    .drag-tag-form__tbody {
                        & > span {
                            display: flex;
                            justify-content: flex-start;
                            align-items: center;
                            flex-flow: row nowrap;
                        }
                    }
                    .child-table-item {
                        width: 136px;
                        font-size: 0.14rem;
                        text-align: center;
                        border: 1px solid #C7CAD3;
                        border-right: 0;
                        &.selected-control {
                            box-sizing: border-box;
                            border: 1px dashed #de2728!important;
                            //background: rgba(253, 123, 123, 0.15);
                            & + .child-table-item {
                                border-left: 0;
                            }
                        }
                        &.first {
                            width: 74px;
                            .title {
                                width: 74px;
                            }
                        }
                        &.last {
                            border-right: 1px solid #C7CAD3;
                            width: 116px;
                            height: 120px;
                        }
                        p {
                            margin: 0;
                            line-height: 36px;
                        }
                        .title {
                            width: 136px;
                            border-bottom: 1px solid #C7CAD3;
                            font-size: 16px;
                            font-family: "PingFang SC Medium";
                            line-height: 43px;
                            color: #37383a;
                            @include textEllipsis();
                            &.is_required:before {
                                content: "*";
                                color: #de2728;
                                margin-right: 4px;
                            }
                            input {
                                width: calc(100% - 8px);
                                margin: 0 4px;
                            }
                        }
                        .content {
                            padding: 0 4px;
                            font-size: 16px;
                            font-family: "PingFang SC Medium";
                            font-weight: 300;
                            color: #37383a;
                            height: 74px;
                            @include flexLayout(flex,center,center);
                        }
                        .add-btn {
                            height: 116px;
                        }
                    }
                    &.hasRight {
                        .child-table-item:last-child {
                            border-right: 1px solid #C7CAD3;
                        }
                    }
                }
            }
        }
    }
    .drag-tag-form__tr,
    .drag-tag-form__th{
        width: 100%;
        @include flexLayout(flex, normal, center);
        background-color: $drag-tag-form-th-bg;
        .drag-tag-form__td{
            flex: 0 1 100%;
            text-align: center;
            color: $drag-tag-form-th-color;
            font-size: .14rem;
            height: .48rem;
            padding: 0 .12rem;
            @include flexLayout(flex, center, center);
            &.optionValueText{
                flex: 0 0 auto;
                width: 2.2rem;
            }
            .drag-tag-form__sub-text{
                width: 80%;
                @include textEllipsis();
            }
        }
    }
    .drag-tag-form__tr{
        background-color: $drag-tag-form-tr-bg;
        .drag-tag-form__td{
            border: 1px solid $drag-tag-form-tr-border-color;
            color: $drag-tag-form-tr-color;
            &+.drag-tag-form__td{
                border-left: none;
            }
        }
        &+.drag-tag-form__tr .drag-tag-form__td{
            border-top: none;
        }
    }
    .drag-tag-form__tr-empty{
        padding: .2rem 0;
    }
    .drag-tag-form__group{
        padding: .1rem 0;
    }
    .ghost {
        opacity: 0.5;
        background: #c8ebfb;
    }
}

.form-collapse {
    width: 100%;
    border-radius: 4px;
    margin-left: 10px;
    ::v-deep {
        .el-collapse-item {
            border: 1px solid #C7CAD3;
        }
        .el-collapse-item__header {
            height: 60px;
            margin: 0 15px;
            border-bottom: 0;
            background: transparent;
        }
        .el-collapse-item__header.is-active {
            height: 60px;
            border-bottom: 1px solid #EDEFF2;
        }
        .el-collapse-item__content {
            padding: 0 15px 0 5px;
        }
        .el-collapse-item__wrap {
            border: 0;
            background: transparent;
        }
        .el-collapse-item__arrow {
            padding: 8px;
        }
    }
}

.control-item {
    position: relative;
    .delete-icon {
        position: absolute;
        right: 14px;
        top: -10px;
        cursor: pointer;
        display: block;
        font-size: 20px;
        width: 20px;
        height: 20px;
        @include flexLayout(flex,center,center);
    }
    .control-item-name {
        font-size: 16px;
        font-family: "PingFang SC Medium";
        line-height: 22px;
        color: #37383a;
        margin: 0 0 7px 0;
        @include textEllipsis();
        &.is_required:before {
            content: "*";
            color: #de2728;
            margin-right: 4px;
        }
    }
    .normal-input {
        line-height: 22px;
        margin-bottom: 7px;
        ::v-deep {
            input {
                height: 22px;
                line-height: 22px;
            }
        }
        &.normal-input-table {
            margin-bottom: 0;
            width: 50%;
        }
    }
    .normal-input-collapse {
        width: 50%;
        margin-right: 40%;
    }
    &.child-table-item {
        .delete-icon {
            right: 0;
            top: 0;
        }
    }
    &.form-collapse, &.child-table, &.form-item {
        margin-bottom: 10px;
    }
    ::v-deep {
        .el-input__inner {
            background: transparent;
        }
    }
}

.selected-control {
    box-sizing: border-box;
    border: 1px dashed #de2728!important;
    //background: rgba(253, 123, 123, 0.15);
    ::v-deep {
        .el-collapse-item.is-active {
            border-bottom: 1px dashed #de2728;
        }
        .el-collapse-item {
            border: 0;
        }
    }
}
